home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / BoopsiListBrowserTags.st < prev    next >
Text File  |  2002-05-06  |  14KB  |  378 lines

  1. " -------------------------------------------------------------------- "
  2. " BoopsiLayoutTags Class is a Singleton class that allows the user     "
  3. " to reference BOOPSI Layout class tags' hexadecimal values.           "
  4. ""
  5. "  EXAMPLE:  'myTag <- layoutTags getTag: #LAYOUT_VertSpacing'         "
  6. "" 
  7. " ALL singleton classes MUST contain the following:                    "
  8. "" 
  9. "  the methods:  isSingleton AND privateSetup     AND                  "
  10. "                 uniqueInstance Class instance variable.              "
  11. " -------------------------------------------------------------------- "
  12.  
  13. Class BoopsiLayoutTags :Dictionary ! uniqueInstance !
  14. [
  15.    isSingleton
  16.      ^ true  
  17. |  
  18.    privateNew ! newinstance !
  19.      newinstance <- super new.
  20.  
  21.      ^ newinstance
  22. |
  23.    new
  24.      ^ self privateSetup
  25. |
  26.    getTag: tagKey
  27.      ^ self at: tagKey
  28. |
  29.    privateInitializeDictionary
  30.  
  31.      " MethodID's: "
  32.  
  33.      self at: #LBM_ADDNODE      put: 16r580001.
  34.      self at: #LBM_REMNODE      put: 16r580002.
  35.      self at: #LBM_EDITNODE     put: 16r580003.
  36.      self at: #LBM_SORT         put: 16r580004.
  37.      self at: #LBM_SHOWCHILDREN put: 16r580005.
  38.      self at: #LBM_HIDECHILDREN put: 16r580006.
  39.  
  40.      " (BOOL) If the node is to be selected.  Defaults to FALSE. "
  41.      self at: #LBNA_Selected    put: 16r85003501.
  42.  
  43.      " (ULONG) Flags for the node.  Defaults to 0. "
  44.      self at: #LBNA_Flags       put: 16r85003502.
  45.  
  46.      " (ULONG) User data.  Defaults to NULL. "
  47.      self at: #LBNA_UserData    put: 16r85003503.
  48.  
  49.      " (WORD) Column in the node that the attributes 
  50.      * below effect.  Defaults to 0.
  51.      "
  52.      self at: #LBNA_Column      put: 16r85003504.
  53.  
  54.      " (STRPTR) Text to display in the column.  Defaults to NULL. "
  55.      self at: #LBNCA_Text       put: 16r85003505.
  56.  
  57.      " (LONG *) Pointer to an integer to display in the column.
  58.      * Defaults to NULL. 
  59.      "
  60.      self at: #LBNCA_Integer    put: 16r85003506.
  61.  
  62.      " (WORD) Column foreground pen. "
  63.      self at: #LBNCA_FGPen      put: 16r85003507.
  64.  
  65.      " (WORD) Column background pen. "
  66.      self at: #LBNCA_BGPen      put: 16r85003508.
  67.  
  68.      " (struct Image *) Image to display in the column.  Defaults to NULL. "
  69.      self at: #LBNCA_Image      put: 16r85003509.
  70.  
  71.      " (struct Image *) Image to display in column when
  72.      * selected.  Defaults to NULL. 
  73.      "
  74.      self at: #LBNCA_SelImage      put: 16r8500350A.
  75.  
  76.      self at: #LBNCA_HorizJustify  put: 16r8500350B.
  77.  
  78.      " (ULONG) Column justification.  Defaults to LCJ_LEFT. "
  79.      self at: #LBNCA_Justification put: 16r8500350B.
  80.  
  81.      " Node generation.  Defaults to 0. "
  82.      self at: #LBNA_Generation     put: 16r8500350C.
  83.  
  84.      " (BOOL) If this column is editable.  Requires LBNCA_CopyText.
  85.      * Defaults to FALSE. 
  86.      "
  87.      self at: #LBNCA_Editable      put: 16r8500350D.
  88.  
  89.      " (WORD) Maximum characters in an editable entry.  Required when using
  90.      * LBNCA_Editable. 
  91.      "
  92.      self at: #LBNCA_MaxChars      put: 16r8500350E.
  93.  
  94.      " Copy the LBNCA_Text contents to an internal buffer. "
  95.      self at: #LBNCA_CopyText      put: 16r8500350F.
  96.  
  97.      " (BOOL) this is a checkbox node "
  98.      self at: #LBNA_CheckBox       put: 16r85003510.
  99.  
  100.      " (BOOL) is checked if true "
  101.      self at: #LBNA_Checked        put: 16r85003511.
  102.  
  103.      " (ULONG) size of custom node and optimzie mempool puddles "
  104.      self at: #LBNA_NodeSize       put: 16r85003512.
  105.  
  106.      " (struct TagItem *) taglist sent to editable string "
  107.      self at: #LBNCA_EditTags      put: 16r85003513.
  108.  
  109.      " (struct Hook *) effectivly the same as gadtools listview hook "
  110.      self at: #LBNCA_RenderHook    put: 16r85003514.
  111.  
  112.      " (WORD) height in pixels of the hook function rendering "
  113.      self at: #LBNCA_HookHeight    put: 16r85003516.
  114.  
  115.      " (APTR) exec memory pool to use "
  116.      self at: #LBNA_MemPool        put: 16r85003517.
  117.  
  118.      " (WORD) for GetListBrowserNodeAttrs() only! "
  119.      self at: #LBNA_NumColumns     put: 16r85003518.
  120.  
  121.      " (UBYTE) Sets the exec node->ln_Pri "
  122.      self at: #LBNA_Priority       put: 16r85003519.
  123.  
  124.      " (BOOL) AllocListBrowserNodeAttrs() or SetListBrowserNodeAttrs() only! "
  125.      self at: #LBNCA_CopyInteger   put: 16r8500351A.
  126.  
  127.      " (BOOL) WordWrap this node's LBNCA_Text data "
  128.      self at: #LBNCA_WordWrap      put: 16r8500351B.
  129.  
  130.      " (ULONG) Row justification.  Defaults to LRJ_BOTTOM. "
  131.      self at: #LBNCA_VertJustify   put: 16r8500351C.
  132.  
  133.  
  134.      " Flags for the LBNA_Flags node attribute: "
  135.      self at: #LBFLG_READONLY      put: 1.
  136.      self at: #LBFLG_CUSTOMPENS    put: 2.
  137.      self at: #LBFLG_HASCHILDREN   put: 4.
  138.      self at: #LBFLG_SHOWCHILDREN  put: 8.
  139.      self at: #LBFLG_HIDDEN        put: 16.
  140.  
  141.  
  142.      " Justification modes for the LBNA_HorizJustify
  143.      * node column attribute. 
  144.      "
  145.      self at: #LCJ_LEFT            put: 0.
  146.      self at: #LCJ_CENTER          put: 1.
  147.      self at: #LCJ_RIGHT           put: 2.
  148.      self at: #LCJ_CENTRE          put: 1.
  149.  
  150.  
  151.      " Justification modes for the LBNA_VertJustify
  152.      * node column attribute.
  153.      "
  154.      self at: #LRJ_BOTTOM          put: 0.
  155.      self at: #LRJ_CENTER          put: 1.
  156.      self at: #LRJ_TOP             put: 2.
  157.      self at: #LRJ_CENTRE          put: 1.
  158.  
  159.  
  160.      " These definitions are for the LBNCA_RenderHook tag. "
  161.  
  162.      " The different types of messages that a listview
  163.      * callback hook can see. 
  164.      "
  165.      self at: #LB_DRAW             put: 16r202. " Draw yourself, with state "
  166.  
  167.      " Possible return values from a render hook. "
  168.      self at: #LBCB_OK          put: 0. " callback understands this message type "
  169.      self at: #LBCB_UNKNOWN     put: 1. " callback does not understand this message "
  170.  
  171.      " States for LBDrawMsg.lbdm_State. "
  172.      self at: #LBR_NORMAL       put: 0. " The usual "
  173.      self at: #LBR_SELECTED     put: 1. " For selected gadgets   "
  174.  
  175.      " Possible ColumnInfo Flags "
  176.      self at: #CIF_WEIGHTED     put: 0. " weighted width column "
  177.      self at: #CIF_FIXED        put: 1. " fixed pixel width column "
  178.      self at: #CIF_DRAGGABLE    put: 2.
  179.      self at: #CIF_NOSEPARATORS put: 4.
  180.      self at: #CIF_SORTABLE     put: 8.
  181.  
  182.      " v45 AllocLBColumnInfo(), SetLBColumnInfo(), GetLBColumnInfo()
  183.      * attributes.
  184.      " 
  185.  
  186.      self at: #LBCIA_MemPool    put: 16r85003532. " (APTR) MemPool for ColumnInfo "
  187.      self at: #LBCIA_Column     put: 16r85003533.
  188.      self at: #LBCIA_Title      put: 16r85003534.
  189.      self at: #LBCIA_Weight     put: 16r85003535.
  190.      self at: #LBCIA_Width      put: 16r85003536.
  191.      self at: #LBCIA_Flags      put: 16r85003537.
  192.  
  193.      " Additional attributes defined by the List Browser class: "
  194.  
  195.      " (LONG) Top position node. Defauts to 0. "
  196.      self at: #LISTBROWSER_Top           put: 16r85003001.
  197.  
  198.      self at: #LISTBROWSER_Reserved1     put: 16r85003002.  " RESERVED "
  199.  
  200.      " (struct List *) Defaults to ~0. "
  201.      self at: #LISTBROWSER_Labels        put: 16r85003003.
  202.  
  203.      " (LONG) numeric index of node currently selected; Defaults to -1. "
  204.      self at: #LISTBROWSER_Selected      put: 16r85003004.
  205.  
  206.      " (struct Node *) node currently seleted "
  207.      self at: #LISTBROWSER_SelectedNode  put: 16r85003005.
  208.  
  209.      " (BOOL) Defaults to FALSE. "
  210.      self at: #LISTBROWSER_MultiSelect   put: 16r85003006.
  211.  
  212.      self at: #LISTBROWSER_VertSeparators put: 16r85003007.
  213.  
  214.      " (BOOL) Render column separators. Defaults to TRUE. "
  215.      self at: #LISTBROWSER_Separators     put: 16r85003007.
  216.  
  217.      " (struct ColumnInfo *) Defaults to NULL. "
  218.      self at: #LISTBROWSER_ColumnInfo    put: 16r85003008.
  219.  
  220.      self at: #LISTBROWSER_MakeVisible   put: 16r85003009. " (LONG) Defaults to 0. "
  221.  
  222.      self at: #LISTBROWSER_VirtualWidth  put: 16r8500300A. " (WORD) Defaults to 0. "
  223.  
  224.      self at: #LISTBROWSER_Borderless    put: 16r8500300B. " (BOOL) Defaults to FALSE. "
  225.  
  226.      self at: #LISTBROWSER_VerticalProp  put: 16r8500300C. " (BOOL) Defaults to TRUE. "
  227.  
  228.      self at: #LISTBROWSER_HorizontalProp put: 16r8500300D. " (BOOL) Defaults to FALSE. "
  229.  
  230.      self at: #LISTBROWSER_Left          put: 16r8500300E.  " (WORD) Defaults to 0. "
  231.  
  232.      self at: #LISTBROWSER_Reserved2     put: 16r8500300F.  " RESERVED "
  233.  
  234.      self at: #LISTBROWSER_AutoFit       put: 16r85003010.  " (BOOL) Defaults to FALSE. "
  235.  
  236.      self at: #LISTBROWSER_ColumnTitles  put: 16r85003011.  " (BOOL) Defaults to FALSE. "
  237.  
  238.      self at: #LISTBROWSER_ShowSelected  put: 16r85003012.  " (BOOL) Defaults to FALSE. "
  239.  
  240.      self at: #LISTBROWSER_VPropTotal    put: 16r85003013.
  241.      self at: #LISTBROWSER_VPropTop      put: 16r85003014.
  242.  
  243.      " State of the vertical prop gadget (if any). "
  244.      self at: #LISTBROWSER_VPropVisible  put: 16r85003015.
  245.  
  246.      self at: #LISTBROWSER_HPropTotal    put: 16r85003016.
  247.      self at: #LISTBROWSER_HPropTop      put: 16r85003017.
  248.    
  249.      " State of the horizontal prop gadget (if any). "
  250.      self at: #LISTBROWSER_HPropVisible  put: 16r85003018.
  251.  
  252.      " (WORD) Returns position of mouse release. "
  253.      self at: #LISTBROWSER_MouseX        put: 16r85003019.
  254.      self at: #LISTBROWSER_MouseY        put: 16r8500301A.
  255.  
  256.      " (BOOL) Enables ListTree mode. Defaults to FALSE. "
  257.      self at: #LISTBROWSER_Hierarchical  put: 16r8500301B.
  258.  
  259.      " (struct Image *) ListTree expanded branch custom image.
  260.      * Defaults to NULL. 
  261.      "
  262.      self at: #LISTBROWSER_ShowImage     put: 16r8500301C.
  263.  
  264.      " (struct Image *) ListTree colapsed branch custom image.
  265.      * Defaults to NULL. 
  266.      "
  267.      self at: #LISTBROWSER_HideImage     put: 16r8500301D.
  268.  
  269.      " (struct Image *) ListTree branch item custom image. Defaults to NULL. "
  270.      self at: #LISTBROWSER_LeafImage     put: 16r8500301E.
  271.  
  272.      " (BOOL) See autodocs for Intuition V37 bug.  Defaults to TRUE. "
  273.      self at: #LISTBROWSER_ScrollRaster  put: 16r8500301F.
  274.  
  275.      self at: #LISTBROWSER_Spacing       put: 16r85003020. " (WORD) Defaults to 0. "
  276.      self at: #LISTBROWSER_Editable      put: 16r85003021. " (WORD) Defaults to FALSE. "
  277.      self at: #LISTBROWSER_EditNode      put: 16r85003023. " (LONG) Specify a node to edit. "
  278.      self at: #LISTBROWSER_EditColumn    put: 16r85003024. " (WORD) Specify a column to edit "
  279.  
  280.      " (struct TagItem *) Taglist passed to editible node string gadget.
  281.      * Defaults to NULL. 
  282.      "
  283.      self at: #LISTBROWSER_EditTags      put: 16r85003027.
  284.  
  285.      " (ULONG) See possible values below. "
  286.      self at: #LISTBROWSER_Position      put: 16r85003022.
  287.  
  288.      " (ULONG) See possible values below. "
  289.      self at: #LISTBROWSER_RelEvent      put: 16r85003025.
  290.  
  291.      " (LONG) Number of selected nodes. "
  292.      self at: #LISTBROWSER_NumSelected   put: 16r85003026.
  293.  
  294.      " (WORD) Column number clicked on. "
  295.      self at: #LISTBROWSER_RelColumn     put: 16r85003028.
  296.  
  297.      " (BOOL) Show horizontal node separators "
  298.      self at: #LISTBROWSER_HorizSeparators put: 16r85003029.
  299.  
  300.      " (struct Image *) Custom checkbox image, Checked state. "
  301.      self at: #LISTBROWSER_CheckImage    put: 16r8500302A.
  302.  
  303.      " (struct Image *) Custom checkbox image, UnChecked state. "
  304.      self at: #LISTBROWSER_UncheckedImage put: 16r8500302B.
  305.  
  306.      self at: #LISTBROWSER_TotalNodes     put: 16r8500302C. " (LONG) Total node count. "
  307.  
  308.      " (LONG) Minimum Node size for custom MemPool custom node optimization "
  309.      self at: #LISTBROWSER_MinNodeSize    put: 16r8500302D.
  310.  
  311.      " (BOOL) Allow column-title bar clicking. "
  312.      self at: #LISTBROWSER_TitleClickable put: 16r8500302E.
  313.  
  314.      " (LONG) Minimum visible node count. This is a causes the
  315.      * minimum domain to be large enough to hold the specified number of
  316.      * nodes using the the estimated average node height. Note, ESTIMATED,
  317.      * this is not garanteed results. The result may be slightly more or
  318.      * less than specified, and potentially alot greater if other objects
  319.      * within the layout group cause the listbrowser to layout larger
  320.      * than its minimum domain.
  321.      "
  322.      self at: #LISTBROWSER_MinVisible     put: 16r8500302F.
  323.      self at: #LISTBROWSER_Reserved6      put: 16r85003030. " RESERVED "
  324.      self at: #LISTBROWSER_Reserved7      put: 16r85003031. " RESERVED "
  325.  
  326.      " (LONG) When set TRUE, SHIFT key is NOT required for multi-select. "
  327.      self at: #LISTBROWSER_PersistSelect  put: 16r85003032.
  328.  
  329.      " (LONG) Keyboard Cursor Selected Node Number "
  330.      self at: #LISTBROWSER_CursorSelect   put: 16r85003033.
  331.  
  332.      " (struct Node *) Keyboard Cursor Selected Node "
  333.      self at: #LISTBROWSER_CursorNode     put: 16r85003034.
  334.  
  335.      " (BOOL) Causes use of mask planes, and turns off custom pen support "
  336.      " The improvement with deep ECS or AGA display is *HUGE*. "
  337.      self at: #LISTBROWSER_FastRender     put: 16r85003035.
  338.  
  339.      " (LONG) Total visible node count. "
  340.      self at: #LISTBROWSER_TotalVisibleNodes put: 16r85003036.
  341.  
  342.      " (BOOL) Enable word wrap of text nodes "
  343.      self at: #LISTBROWSER_WrapText          put: 16r85003037.
  344.  
  345.      " Possible values for LISTBROWSER_Position: "
  346.      self at: #LBP_LINEUP        put: 1.
  347.      self at: #LBP_LINEDOWN      put: 2.
  348.      self at: #LBP_PAGEUP        put: 3.
  349.      self at: #LBP_PAGEDOWN      put: 4.
  350.      self at: #LBP_TOP           put: 5.
  351.      self at: #LBP_BOTTOM        put: 6.
  352.      self at: #LBP_SHIFTLEFT     put: 10.
  353.      self at: #LBP_SHIFTRIGHT    put: 11.
  354.      self at: #LBP_LEFTEDGE      put: 12.
  355.      self at: #LBP_RIGHTEDGE     put: 13.
  356.  
  357.      " Possible values for LISTBROWSER_RelEvent: "
  358.      self at: #LBRE_NORMAL       put: 1.
  359.      self at: #LBRE_HIDECHILDREN put: 2.
  360.      self at: #LBRE_SHOWCHILDREN put: 4.
  361.      self at: #LBRE_EDIT         put: 8.
  362.      self at: #LBRE_DOUBLECLICK  put: 16.
  363.      self at: #LBRE_CHECKED      put: 32.
  364.      self at: #LBRE_UNCHECKED    put: 64.
  365.      self at: #LBRE_TITLECLICK   put: 128.
  366.      self at: #LBRE_COLUMNADJUST put: 256.
  367. |
  368.    privateSetup
  369.      (uniqueInstance isNil)
  370.        ifTrue: [uniqueInstance <- self privateNew.
  371.                 
  372.                 self privateInitializeDictionary.
  373.                ].
  374.                
  375.      ^ self    "or ^ uniqueInstance??"
  376. ]
  377.  
  378.